package com.farm.bpm.variable;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.farm.core.auth.domain.LoginUser;

public class VariableProvider {
	private static final String BPM_STARTUSER = "bpmStartUser";
	private static final String BPM_STARTUSER_NAME = "bpmStartUserName";

	public static Map<String, Object> getProcessStartVariable(
			LoginUser aloneUser, List<String> list) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put(BPM_STARTUSER, aloneUser.getId());
		map.put(BPM_STARTUSER_NAME, aloneUser.getName());
		return map;
	}

	public static List<Map<String, Object>> getAllVariableDescribe() {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		list = addVarDescribe(list, BPM_STARTUSER, "启动流程的用户ID");
		list = addVarDescribe(list, BPM_STARTUSER_NAME, "启动流程的用户姓名");
		return list;
	}

	private static List<Map<String, Object>> addVarDescribe(
			List<Map<String, Object>> list, String key, String name) {
		Map<String, Object> map1 = new HashMap<String, Object>();
		map1.put("KEY", key);
		map1.put("NAME", name);
		list.add(map1);
		return list;
	}
}
